home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1993…stman Always Clicks Twice / ADC Developer CD (1993-01) (''The Postman Always Clicks Twice'')_iso / Dev.CD 199301.iso / Development Platforms / LISP Related / LISP Goodies / menu enhancements / about-marking-menus next >
Encoding:
Text File  |  1992-09-02  |  13.5 KB  |  303 lines  |  [TEXT/CCL2]

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;; about-marking-menus.lisp
  3. ;;
  4. ;; Copyright © 1992 University of Toronto, Department of Computer Science
  5. ;; All Rights Reserved
  6. ;;
  7. ;; author: Mark A. Tapia
  8. ;; 
  9. ;; A description of the menu-enhancements package and the underlying
  10. ;; concepts.
  11. ;;
  12. ;; Acknowledgements:
  13. ;; This package uses routines from the oodles-of-utils package in the
  14. ;; gdevice-u, quickdraw-u and patches modules.
  15. ;; The routines are credited when used.
  16. ;;
  17. ;; Revision history:
  18. ;;  1992-05-13 Added support for color screens and automatic menu sizing
  19. ;;  1992-05-24 Added support for MCL2.0f
  20. ;;  
  21. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  22. (in-package cl-user)
  23.  
  24. #|
  25. Menu extensions
  26. The mixins in menu extensions allow the designer to associate 
  27. a menu with a view without modifying the menu-bar and to
  28. invoke a menu by holding the mouse button down within the
  29. view.  Menus of this form can pop up anywhere in the view.
  30. The mixins in menu extensions also add a subclass of
  31. menu-items that remember the checkmark character.
  32.  
  33. The menu extensions are defined in a package called 
  34. :menu-enhancements with a nickname of :menus.
  35.  
  36. Running the demonstrations
  37. The menu extension package contains two demonstration files that 
  38. exercise the various features of marking menus.
  39.  
  40. To run the demos, perform the following steps:
  41. 1. If you are running MCL2.0 final or higher, you will need to
  42.    load 
  43.       load-demos.lisp
  44.    Otherwise load
  45.       load-demos-old.lisp
  46.  
  47.    Loading the file will automatically recompile the files if needed,
  48.    will load the fasl files for marking menus and for the demos.
  49.  
  50.    Note:
  51.    If the files are not in ccl: directory, you will need to modify
  52.    the directory structure.
  53.    If you are running MCL2.0f, change the setf expressions for the
  54.    logical-pathname-translations in load-demos.lisp.
  55.    Otherwise change the def-logical-directory in load-demos-old.lisp
  56.  
  57. 2. Run the demos by evaluating one of the two forms:
  58.      (cl-user::hier-demo)           ; to run the hierarchical demo
  59.  
  60.      (cl-user::marking-demo)        ; to run the standard marking menu demo
  61.  
  62. Functions with the suffix -demo, demonstrate individual features 
  63. of marking-menus: These functions are accessible in the cl-user package.
  64.       (cl-user::nested-demo)            ; marking menus with nested views
  65.       (cl-user::table-demo)             ; marking menus with tables
  66.       (cl-user::marking-demo)           ; nested-demo/table-demo
  67.                                         ; and change the options
  68.       (cl-user::hier-demo)              ; demonstrate hierarchical menus
  69.  
  70. Files
  71. There are several files in this directory:
  72.    about-marking-menus.lisp             ; this file
  73.  
  74.    check-menu-item.lisp                 ; defines menu-items that remember checkmarks
  75.  
  76.    hier-menu-demo.lisp                  ; sample code which demonstrates 
  77.                                         ; hier marking menus
  78.  
  79.    load-demos.lisp                      ; loads the MCL2.0 final version of menus and demos
  80.  
  81.    load-demos-old.lisp                  ; loads the MCL2.0b1 version of menus and demos
  82.  
  83.    load-menus.lisp                      ; loads the MCL2.0 final version of menus
  84.  
  85.    load-menus-old.lisp                  ; loads the MCL2.0b1 version of menus
  86.  
  87.    make-menus.lisp                      ; compiles and loads the menu-enhancements
  88.                                         ; package
  89.  
  90.    marking-menu.lisp                    ; defines a class of pop up marking menus
  91.                                         ; menu items within a -marking-menu can 
  92.                                         ; also be marking-menus
  93.  
  94.    marking-menu-demo.lisp               ; a demonstration of marking menus and check
  95.                                         ; menu items
  96.  
  97.    oou-utils.lisp                       ; utility routines from oodles-of-utils.lisp
  98.                                         ; including macros for executing forms after saving 
  99.                                         ; rectangular portions of screen bit maps
  100.                                         ; and then restoring them upon termination
  101.  
  102. Using the marking menus in your program
  103. To use the menu extensions, perform the following steps
  104. 1. If you are running MCL2.0 final or higher, you will need to
  105.    load 
  106.       load-menus.lisp
  107.    Otherwise load
  108.       load-menus-old.lisp
  109.  
  110.    Loading the file will automatically recompile the files if needed,
  111.    will load the fasl files for marking menus and for the demos.
  112.  
  113.    Note:
  114.    If the files are not in ccl: directory, you will need to modify
  115.    the directory structure.
  116.    If you are running MCL2.0f, change the setf expressions for the
  117.    logical-pathname-translations in load-menus.lisp.
  118.    Otherwise change the def-logical-directory in load-menus-old.lisp
  119.  
  120.  
  121. 2. Include the following statement to access the menu extensions
  122.    (use-package :menus)
  123.  
  124. 3. Include the following calls to require:
  125.    (require 'marking-menus)             ; to use marking menus
  126.  
  127.    (require 'check-menus)               ; to use menu-items that remember
  128.                                         ; the checkmark character
  129.  
  130. A desciption of marking menus
  131. Marking menus are similar to pop-up-menus. Unlike pop-up-menus, a marking menu
  132. can be activated at any point in a marking-menu-view by pressing the mouse
  133. button down and either waiting or moving. The menu appears whenever the
  134. mouse button is still depressed and the mouse does not move appreciably in
  135. a specified period of time. Marking menus are described in
  136.       Kurtenbach, G. & Buxton W.  (1991) Issues in combining marking and 
  137.          direct manipulation techniques. Proceedings of UIST '91, 
  138.          New York:ACM, 137-144
  139.  
  140. Unlike pop-up menus, marking-menus occupy screen space only when 
  141. they pop up; selections can be made from a marking menu without
  142. displaying the menu by marking ahead.
  143.  
  144. Marking menus allow the designer to associate menus with specific views
  145. and to activate the menu whenever there is a mouse click within the
  146. most specific view. Double-click actions are also supported. Marking
  147. menus eliminate cluttered menu bars, since they use the context supplied
  148. by the view. 
  149.  
  150. A marking menu is very much like a regular pop up menu.  When a user 
  151. presses the mouse button down over a view with a marking menu, 
  152. the menu pops up at that location.
  153.  
  154. A marking menu differs from a regular pop-up menu in several ways. 
  155. First, a marking menu is circular or spoke-like.  Second, a
  156. marking menu occupies screen space only when it pops up and is
  157. otherwise invisble. Third, selecting from a pie menu is faster
  158. than selecting an item from a regular linear pop-up menus,
  159. since selections depend on the angle between the cursor when it
  160. is released and the center of the menu and not with the distance.
  161.  
  162. Selection from a marking menu can be accelerated by moving the cursor 
  163. in the direction of the desired item, without waiting for the menu
  164. to pop up. The cursor leaves an ink trail or mark to provide feedback
  165. on the selected direction. The marks provide the impetus for the name
  166. of this class of menus - marking menus.
  167.  
  168. The idea is that frequent use of the menu allows the user to learn
  169. the direction for menu items and to make the mark without waiting
  170. for the menu to appear. Using menus without waiting is faster and
  171. eliminates irritating blinking graphics associated with standard 
  172. pull-down or pop-up menus.
  173.  
  174. Marking menus support both novices and experts and encourage a smooth
  175. transition between the two styles of interaction: 
  176. *   The first time or novice users wait for the the pop-up marking
  177.     menu to appear before moving and making a selection.
  178. *   Experts select menu choices more quickly by making a mark 
  179.     without waiting for the menu to pop-up. Experts memorize the
  180.     directions associated with frequently used menu items.
  181.     Standard linear pop-up (or pull-down) menus force experts to
  182.     use a separate mechanism for fast selection (e.g. command-key
  183.     short-cuts) to avoid menu display. 
  184. *   Users who are neither novices not experts can make a mark, then
  185.     wait for the menu to pop up before releasing the button. Waiting
  186.     at any time without releasing the botton causes the menu to pop up.
  187.     If an incorrect item is selected, another one can simply be
  188.     selected.
  189.  
  190. To accommodate both experts and novices, a marking menu pops up
  191. only after a time delay during which the mouse is relatively static
  192. while the mouse button is still depressed. Selections from the menu 
  193. occur whenever the user moves a sufficient distance from the initial
  194. mouse click position and releases the button. Like command key
  195. short-cuts, marking menus allow the user to issue commands quickly 
  196. without venturing outside the area of interest. Unlike command-key
  197. short cuts, marking menus do not cause distracting menu-bar flashing. 
  198.  
  199. A marking menu is active whenever the mouse button is pressed down
  200. in a marking-menu-view. The menu is associated with most specific 
  201. marking-menu-view containing the point. The center of the menu
  202. coincides with the initial point.
  203.  
  204. Releasing the button within the center of the menu does not select
  205. an item.
  206.  
  207. Releasing the botton outside the central hole, selects an item if
  208. it is not disabled and runs the associated menu-item-action.
  209.  
  210. The menu is displayed whenever the mouse button is down, and
  211. menu-pop-up-time clicks have elapsed while the mouse position
  212. has changed at most menu-start-tol pixels in the h and v
  213. direction from the previous position.
  214.  
  215. When the menu is displayed, a rubber band line joins the current
  216. mouse position to the center of the menu (the initial position of
  217. the mouse-click). When the line passes through a wedge corresponding
  218. to an enabled item, the item appears in reverse video. Disabled menu
  219. items appear in grayish text and are not hilited.
  220.  
  221. Novices can wait for the menu to appear, before selecting an item.
  222.  
  223. Expert users can bypass the menu display, by mousing ahead and then
  224. releasing the button. The mouse leaves an ink trail that may traverse
  225. the entire screen.
  226.  
  227. Intermediate users (or experts who forget the marks) can pause at
  228. any time to allow the menu to pop up.
  229.  
  230. Hierarchical marking menus
  231. Marking menus also support hierarchical menus. Menu items in a
  232. hierarchical marking menu (marking-menu-view) may also be marking
  233. menu views. Although the menus may be nested to any depth, menus
  234. should be no more than three deep.  With four choices at each
  235. level, this allows 64 menu choices.
  236.  
  237. Hierarchical menus support simple backtracking.
  238.  
  239. To invoke a marking menu, press the mouse button down within a view.
  240. A menu will then appear. To select a standard menu item, release
  241. the mouse outside the central circle. To select a menu item that
  242. is also a menu, hold the mouse button down, continue moving away 
  243. from the central area until the next marking menu appears 
  244. (it appears outside the circle defining the menu).
  245. To select a menu item, move in the direction of the menu item. 
  246. Release the button to select a standard menu item; for menu
  247. items that are menus, repeat the process.
  248.  
  249. You can also start the process by moving outside the circle 
  250. leaving a mark and then pausing until the root menu and
  251. the  marking sub-menu appear. Ultimately the system will
  252. allow you to make marks without displaying the menus.
  253.  
  254. Returning to the central region of a previous menu and pausing, 
  255. returns control to that menu. When the pause point appears in 
  256. the interior circle of more than one marking menu, control will
  257. return to the most recent menu. Releasing the button before
  258. the next marking menu appears and before venturing outside
  259. the circle cancels the entire sequence of menus. 
  260.  
  261. Exported classes:
  262. The menus package exports the following classes of objects:
  263.     marking-menu-view                   ; marking menus for views
  264.     marking-menu-window                 ;                   windows
  265.     marking-menu-table                  ;                   tables
  266.  
  267. The classes are described below, for information on the initargs and
  268. the relevant methods, see the source code file.
  269.  
  270. Marking-menu-views                      ; a mixin of marking-menu and view
  271. a marking-menu-view is a view which has a marking-menu associated with it.
  272. Marking-views can coexist with other items: editable dialog-items, buttons, 
  273. table-dialog-items, check-boxes. Mouse clicks are handled by the most specific
  274. view that has a mouse-click-event-handler. For example, if a marking-view
  275. contains a check-box-dialog-item, pressing the mouse down in the dialog-item
  276. will check/uncheck the item and the marking menu will not appear.
  277.  
  278. Marking-menu-window                     ; a mixin of marking-menu-view and window
  279. A marking-menu-window is a window with a marking-menu associated with the
  280. content region of the window (not with the close box, title bar, grow box,
  281. size box, scroll bars etc.)
  282.  
  283. Check-menu-items
  284. Check-menu-items store the check mark associated with them. The mark can
  285. be specified in three ways:
  286.   1. by specifying the mark when initializing the instance.
  287.        (make-instance 'check-menu-item :mark #\CheckMark)
  288.        which is equivalent to (make-instance 'check-menu-item :mark t)
  289.   2. by the set-check-mark-char method specifying a mark that is not t or nil. 
  290.         (set-check-mark-char check-menu-item mark) 
  291.   3. by the set-menu-item-check-mark method specifying a mark that
  292.      is not t or nil.
  293.         (set-check-menu-item-check-mark check-menu-item mark)
  294.      (set-menu-item-check-mark check-menu-item t) uses the previously
  295.      specified check mark.
  296.  
  297.   Methods 1-2 do not check the item. Method 3 changes the character and checks
  298.   the item.
  299.  
  300.   Use the initarg :mark to set the character (default #\checkMark)
  301.   Use (set-check-mark char menu-item char) to set the character
  302.   or  (set-menu-item-check-mark menu-item char) where char is not t or nil
  303. |#